from pydantic import BaseModel, Field
from typing import List, Optional, Dict, Any


class EntityInfo(BaseModel):
    category: str = Field(description="商品类别")
    special: Optional[bool] = Field(description="是否为特殊化妆品")
    material: Optional[str] = Field(description="材质信息")
    function: Optional[str] = Field(description="功能特征")
    sensitive_words: List[str] = Field(description="敏感词列表")
    abbreviations: List[dict] = Field(description="缩写及其含义")

class ComplianceResult(BaseModel):
    hs_code: Optional[str] = Field(description="建议的HS编码")
    prohibited_words: List[str] = Field(description="发现的禁用词")
    missing_elements: List[str] = Field(description="缺失的必要申报要素")

class RiskAssessment(BaseModel):
    risk_level: str = Field(description="风险等级：低/中/高")
    similar_violations: List[str] = Field(description="相似违规案例")
    suggestions: List[str] = Field(description="改进建议")
    legal_basis: List[str] = Field(description="法律依据")

class ComplianceCheckResult(BaseModel):
    semantic_analysis: EntityInfo
    compliance_check: ComplianceResult
    risk_assessment: RiskAssessment


class ClassfiyResult(BaseModel):
    classify_name: str = Field(description="分类名称")